package online.shenme.itcast.main;


import online.shenme.itcast.service.ExamService;
import online.shenme.itcast.service.ExamServiceImpl;
import online.shenme.itcast.ui.*;

public class Main {
    public static void main(String[] args) {
        //初始化软件组件(零件)
        LoginFrame loginFrame = new LoginFrame();
        ExamFrame examFrame = new ExamFrame();
        MenuFrame menuFrame = new MenuFrame();
        WelcomeWindow welcomeWindow = new WelcomeWindow();
        ClientContext clientContext = new ClientContext();
        ExamService service = new ExamServiceImpl();


        //组装组件
        loginFrame.setClientContext(clientContext);
        menuFrame.setClientContext(clientContext);
        examFrame.setClientContext(clientContext);
        clientContext.setExamService(service);
        clientContext.setLoginFrame(loginFrame);
        clientContext.setExamFrame(examFrame);
        clientContext.setMenuFrame(menuFrame);
        clientContext.setWelcomeWindow(welcomeWindow);
        //启动软件界面
        clientContext.show();
    }
}
